package com.css.crm.dao.impl;

import java.util.List;
import org.apache.ibatis.session.SqlSession;
import com.css.crm.dao.CustomerTelephoneDao;
import com.css.crm.vo.CustomerTelephoneVo;

/**
 * Implementation for CustomerTelephoneDao
 * 
 * @author AIS
 */
public class CustomerTelephoneDaoImpl extends BaseDaoImpl implements CustomerTelephoneDao {



	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.CustomerTelephoneDao#getCustomerTelephoneByCustId(java
	 * .lang.String)
	 */
	@Override
	public List<CustomerTelephoneVo> getCustomerTelephoneByCustId(String custId) {
		SqlSession session = getMyBatisSession();
		return session.selectList("customerTelephone.getCustomerTelephoneByCustId", custId);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.CustomerTelephoneDao#insertCustomerTelephone(com.css.
	 * crm.vo.CustomerTelephoneVo)
	 */
	@Override
	public int insertCustomerTelephone(CustomerTelephoneVo record) {
		SqlSession session = getMyBatisSession();
		return session.delete("customerTelephone.insertCustomerTelephone", record);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.CustomerTelephoneDao#updateCustomerTelephoneByPK(com.
	 * css.crm.vo.CustomerTelephoneVo)
	 */
	@Override
	public int updateCustomerTelephoneByPK(CustomerTelephoneVo record) {
		SqlSession session = getMyBatisSession();
		return session.update("customerTelephone.updateCustomerTelephoneByPK", record);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.css.crm.dao.CustomerTelephoneDao#deleteCustomerTelephoneByPK(java
	 * .lang.Long)
	 */
	@Override
	public int deleteCustomerTelephoneByPK(Long custAddrId) {
		SqlSession session = getMyBatisSession();
		return session.delete("customerTelephone.deleteCustomerTelephoneByPK", custAddrId);
	}

	@Override
	public int deleteCustomerTelephoneByCustId(String custId) {
		SqlSession session = getMyBatisSession();
		return session.delete("customerTelephone.deleteCustomerTelephoneByCustId", custId);
	}
}
